import multiprocessing
import fast
import time
def test1(c):
    a=time.perf_counter_ns()
    import numpy
    import pandas
    import torch
    b=time.perf_counter_ns()
    c.send(b-a)
def test2(c):
    a=time.perf_counter_ns()
    d=fast.FastImport("numpy","pandas","torch")
    d.get()
    b=time.perf_counter_ns()
    c.send(b-a)
if __name__ == "__main__":
    (c1,c2)=multiprocessing.Pipe()
    (d1,d2)=multiprocessing.Pipe()
    e=0
    f=0
    rangetime=0
    while True:
          a=multiprocessing.Process(target=test1,args=(c1,))
          b=multiprocessing.Process(target=test2,args=(d1,))
          b.start()
          a.start()
          e=c2.recv()*pow(10,-9)+e
          f=d2.recv()*pow(10,-9)+f
          rangetime=rangetime+1
          c=e/rangetime
          d=f/rangetime
          print((1-d/c)*100,rangetime)